@(userForm: Form[User], isAdmin: Boolean, userAdmin: Boolean, msg: String)
@helper.form(action = routes.Users.addUser) {
    <input name="id" type="hidden" value="@userForm("id").value" />
    @helper.inputText(userForm("username"))
    @if(userForm("id").value == null || userForm("id").value.isEmpty){
        @helper.inputPassword(userForm("password"))
    }
    @if(isAdmin){
        @helper.checkbox(userForm("isAdmin"), '_label -> "admin")
    }
    
        <button id="submit-user" class="btn btn-primary">@if(userForm("id").value == null || userForm("id").value.isEmpty){Create}else{Edit}</button>
    @if(!msg.isEmpty()){
        @Html(msg)
    }
}
<script type="text/javascript">
    $(document).ready(function(){
        $('#isAdmin').prop('checked', @userAdmin);
    });
</script>